/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package virtual.BD;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Rafael
 */
@Entity
@Table(name = "aluno")
@NamedQueries({
    @NamedQuery(name = "Aluno.findAll", query = "SELECT a FROM Aluno a"),
    @NamedQuery(name = "Aluno.findByCdAluno", query = "SELECT a FROM Aluno a WHERE a.cdAluno = :cdAluno"),
    @NamedQuery(name = "Aluno.findByNuMatricula", query = "SELECT a FROM Aluno a WHERE a.nuMatricula = :nuMatricula"),
    @NamedQuery(name = "Aluno.findByCdCurso", query = "SELECT a FROM Aluno a WHERE a.cdCurso = :cdCurso")})
public class Aluno implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "cd_aluno")
    private Integer cdAluno;
    @Column(name = "nu_matricula")
    private String nuMatricula;
    @Column(name = "cd_curso")
    private Integer cdCurso;

    public Aluno() {
    }

    public Aluno(Integer cdAluno) {
        this.cdAluno = cdAluno;
    }

    public Integer getCdAluno() {
        return cdAluno;
    }

    public void setCdAluno(Integer cdAluno) {
        this.cdAluno = cdAluno;
    }

    public String getNuMatricula() {
        return nuMatricula;
    }

    public void setNuMatricula(String nuMatricula) {
        this.nuMatricula = nuMatricula;
    }

    public Integer getCdCurso() {
        return cdCurso;
    }

    public void setCdCurso(Integer cdCurso) {
        this.cdCurso = cdCurso;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cdAluno != null ? cdAluno.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Aluno)) {
            return false;
        }
        Aluno other = (Aluno) object;
        if ((this.cdAluno == null && other.cdAluno != null) || (this.cdAluno != null && !this.cdAluno.equals(other.cdAluno))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "virtual.BD.Aluno[cdAluno=" + cdAluno + "]";
    }

}
